﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/adminmain.master" AutoEventWireup="true" CodeFile="managerDetail.aspx.cs" Inherits="admin_managerDetail" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script src="../js/Calendar1.js" type="text/javascript"></script>
    <script type="text/javascript">
        function showImg(value) {
            var img = document.getElementById("editImage");
            img.src = value;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    &nbsp;<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
        CellPadding="4" DataSourceID="ObDetail" ForeColor="#333333" GridLines="None" 
        Height="50px" Width="98%">
        <AlternatingRowStyle BackColor="White" />
        <CommandRowStyle BackColor="#C5BBAF" Font-Bold="True" />
        <EditRowStyle BackColor="#7C6F57" />
        <FieldHeaderStyle BackColor="#D0D0D0" Font-Bold="True" HorizontalAlign="Center" 
            VerticalAlign="Middle" Width="12%" />
        <Fields>
            <asp:TemplateField HeaderText="LId" SortExpression="LId" Visible="False">
                <EditItemTemplate>
                    <asp:Label ID="labLID" runat="server" Text='<%# Bind("LId") %>'></asp:Label>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("LId") %>'></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("LId") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="主人" SortExpression="UserId">
                <EditItemTemplate>
                    <asp:HiddenField ID="hiddenUId" Value='<%# Eval("UserId") %>' runat="server" />
                    <asp:TextBox ID="txtMaster" runat="server" Text='<%# Eval("User.UName") %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="txtMaster" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Eval("User.UName") %>'></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("User.UName") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="物品" SortExpression="GoodsName">
                <EditItemTemplate>
                    <asp:TextBox ID="txtGS" runat="server" Text='<%# Bind("GoodsName") %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                        ControlToValidate="txtGS" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("GoodsName") %>'></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label5" runat="server" Text='<%# Bind("GoodsName") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="信息类型" SortExpression="LostProperty">
                <EditItemTemplate>
                    <asp:TextBox ID="txtInfo" runat="server" Text='<%# Bind("LostProperty") %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                        ControlToValidate="txtInfo" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("LostProperty") %>'></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label6" runat="server" Text='<%# Bind("LostProperty") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="图片" SortExpression="Image">
                <EditItemTemplate>
                    <image id="editImage" src='<%#Eval("Image", "../imgpublish/{0}") %>'/>
                    <asp:FileUpload ID="FUImg" runat="server" onchange="showImg(this.value)" />
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox5" runat="server" 
                        Text='<%# Bind("Image", "~/images/{0}") %>'></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Image ID="Image1" ImageUrl='<%# Bind("Image", "../imgpublish/{0}") %>' runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="地点" SortExpression="Address">
                <EditItemTemplate>
                    <asp:TextBox ID="txtAddress" runat="server" Text='<%# Bind("Address") %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                        ControlToValidate="txtAddress" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("Address") %>'></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label7" runat="server" Text='<%# Bind("Address") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="时间" SortExpression="Time">
                <EditItemTemplate>
                    <asp:TextBox onfocus="calendar()" ID="txtTime" runat="server" 
                        Text='<%# Bind("Time", "{0:yyyy-MM-dd}") %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                        ControlToValidate="txtTime" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox3" runat="server" 
                        Text='<%# Bind("Time", "{0:yyyy-MM-dd}") %>'></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label3" runat="server" 
                        Text='<%# Bind("Time", "{0:yyyy-MM-dd}") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="特征" SortExpression="Feature">
                <EditItemTemplate>
                    <asp:HiddenField ID="HiddenField1" Value='<%# Bind("Feature") %>'   runat="server"/>
                    <iframe id="eWebEditor1" src="../ewebeditor/ewebeditor.htm?id=ctl00$ContentPlaceHolder1$DetailsView1$HiddenField1&style=coolblue" frameborder="0" scrolling="no" width="550" height="350"></iframe>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Feature") %>'></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:HiddenField ID="HiddenField1" Value='<%# Bind("Feature") %>'   runat="server"/>
                    <iframe id="eWebEditor1" src="../ewebeditor/ewebeditor.htm?id=ctl00$ContentPlaceHolder1$DetailsView1$HiddenField1&style=coolblue" frameborder="0" scrolling="no" width="550" height="350"></iframe>
                    
                </ItemTemplate>
            </asp:TemplateField>
            <asp:CommandField ShowEditButton="True" >

            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:CommandField>

        </Fields>
        <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#E3EAEB" />
    </asp:DetailsView>
    <asp:ObjectDataSource ID="ObDetail" runat="server" SelectMethod="getModelById" 
        TypeName="BLL.LostAndFound" DataObjectTypeName="MODEL.LostAndFound" 
        onupdating="ObDetail_Updating" UpdateMethod="modifyInfo">
        <SelectParameters>
            <asp:QueryStringParameter Name="id" QueryStringField="id" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>

